Migrate to file-scoped namespaces#1549
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1549 +/- ##
=====================================
Coverage 90.2% 90.2%
=====================================
Files 423 423
Lines 35476 35476
Branches 2209 2209
=====================================
Hits 32021 32021
Misses 3001 3001
Partials 454 454 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR completes the migration to file-scoped namespaces (C# 10 feature) for code added after the initial migration in #398. The changes modernize the codebase syntax and improve readability by reducing nesting.
- Migrates 6 source files in the Uv detector to file-scoped namespace syntax
- Updates test file UvLockTests.cs to use file-scoped namespaces
- Updates documentation to demonstrate file-scoped namespace pattern
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.ComponentDetection.Detectors.Tests/UvLockTests.cs | Migrates test class from nested to file-scoped namespace |
| src/Microsoft.ComponentDetection.Detectors/uv/UvSource.cs | Migrates source model class to file-scoped namespace |
| src/Microsoft.ComponentDetection.Detectors/uv/UvPackage.cs | Migrates package model class to file-scoped namespace |
| src/Microsoft.ComponentDetection.Detectors/uv/UvLockComponentDetector.cs | Migrates detector implementation to file-scoped namespace |
| src/Microsoft.ComponentDetection.Detectors/uv/UvLock.cs | Migrates lock file parser to file-scoped namespace |
| src/Microsoft.ComponentDetection.Detectors/uv/UvDependency.cs | Migrates dependency model class to file-scoped namespace |
| docs/creating-a-new-service.md | Updates documentation examples to show file-scoped namespace syntax |
|
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
We performed this migration in #398, but this code was added later in #1425.
This also updates our documentation to show file-scoped namespaces.
See https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces